import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import render from '@dfeidao/atom-web/render/render';
import p001 from './p001';
import get from '@dfeidao/atom-web/local/get';
import p002 from './p002';

export default async function a007(fd: IFeidaoAiBrowserComponent) {
	//搜索
	const no = get(fd, 'no');
	//console.log('搜索zj5a007', no)
	const equipment_kind_no = fd.data.node.querySelector<HTMLInputElement>('[data-id="equipment_kind_no"]').value;
	const equipment_kind_name = fd.data.node.querySelector<HTMLInputElement>('[data-id="equipment_kind_name"]').value;
	//console.log('搜索zj5a007', equipment_kind_name)

	const res = await nodejs<{ dt: Array<{}>, t: number }>('device-type/zj-000005/s001', {
		filter: {
			equip_type_no: no,
			equipment_kind_no: equipment_kind_no,
			equipment_kind_name: equipment_kind_name,
			pn: 1
		}
	});
	console.log(res);
	render(fd, res.dt, p001, 'p001', 'inner');
	render(fd, res.t, p002, 'p002', 'inner');
}
